package com.example.basic;

import com.example.basic.snowflake.BitsAllocator;
import com.example.basic.snowflake.OffsetClock;

import java.time.LocalDateTime;

public interface SnowflakeIdGenerator {
    /**
     * 起始时间
     */
    LocalDateTime baseTime = LocalDateTime.of(2017, 5, 11, 0, 0, 0);
    /**
     * 基于分钟
     */
    OffsetClock OFFSET_CLOCK = OffsetClock.minute(baseTime);
    /**
     * 时长: 16年, 工作ID: 4096个, 每分钟: 64个
     */
    BitsAllocator BITS_ALLOCATOR = new BitsAllocator(22, 10, 21);

    long generate();
}
